package com.csun.dsms.service;

import com.csun.dsms.comment.core.support.IService;
import com.csun.dsms.model.domain.DsmsSchedule;
import com.csun.dsms.model.dto.schedule.ScheduleQueryDto;

import java.util.List;

/**
 * @author chisj chisj@foxmail.com
 * @version 1.0.0
 * @date 2021-09-23 15:35
 * @description: TODO
 */
public interface DsmsScheduleService extends IService<DsmsSchedule> {

    /**
     * 初始化任务
     */
    void init();

    /**
     * 启动任务
     *
     * @param scheduleCode  the schedule code
     * @param dsmsSchedule  the dms schedule
     *
     * @return  the int.
     */
    boolean start(String scheduleCode, DsmsSchedule dsmsSchedule);

    /**
     * 停止任务
     *
     * @param scheduleCode  the schedule code
     *
     * @return  the int.
     */
    boolean stop(String scheduleCode);

    /**
     * 重启任务
     *
     * @param scheduleCode  the schedule code
     * @param dsmsSchedule  the dms schedule
     *
     * @return  the int.
     */
    boolean restart(String scheduleCode, DsmsSchedule dsmsSchedule);

    /**
     * select by schedule code
     *
     * @param scheduleCode  the schedule code
     *
     * @return  the dsms schedule
     */
    DsmsSchedule selectByScheduleCode(String scheduleCode);

    /**
     * 查询调度器列表 - 分页
     *
     * @param scheduleQueryDto  the schedule query dto
     *
     * @return  the dsms schedule list.
     */
    List<DsmsSchedule> queryListWithPage(ScheduleQueryDto scheduleQueryDto);
}
